Skip to content

fix(wechat): wait for the body editor before pasting#246

Open
Kim-Huang-JunKai wants to merge 1 commit into
doocs:mainfrom
Kim-Huang-JunKai:codex/fix-wechat-body-editor-race
Open

fix(wechat): wait for the body editor before pasting#246
Kim-Huang-JunKai wants to merge 1 commit into
doocs:mainfrom
Kim-Huang-JunKai:codex/fix-wechat-body-editor-race

Conversation

@Kim-Huang-JunKai
Copy link
Copy Markdown

Summary / 概述

  • fix a WeChat race where the title ProseMirror mounts before the body editor
  • keep waiting until a non-title ProseMirror appears before pasting HTML
  • add a regression test for the title-only mount sequence

Type of Change / 更改类型

  • Bug fix / 修复 Bug (non-breaking change that fixes an issue / 修复问题的非破坏性更改)
  • New feature / 新功能 (non-breaking change that adds functionality / 添加功能的非破坏性更改)
  • Breaking change / 破坏性更改 (fix or feature that would cause existing functionality to not work as expected / 会导致现有功能无法正常工作的修复或功能)
  • Documentation update / 文档更新
  • Performance improvement / 性能优化
  • Code refactoring / 代码重构
  • Other / 其他 (please describe / 请描述):

Changes Made / 更改内容

  • extract a reusable WeChat body-editor picker that excludes title editors
  • return null when only the title editor is mounted so the sync flow keeps waiting for the body editor
  • cover the race condition with a Node test

Testing / 测试

Testing Checklist / 测试清单

  • I have tested this code locally / 我已在本地测试此代码
  • All existing tests pass / 所有现有测试通过
  • I have added tests for new functionality / 我已为新功能添加测试
  • I have tested on the affected platform(s) / 我已在受影响的平台上测试
  • I have verified the changes work in the target browser(s) / 我已验证更改在目标浏览器中有效

Manual Testing Steps / 手动测试步骤

  1. Open the WeChat draft editor where the title ProseMirror mounts before the body editor.
  2. Trigger article sync from the extension.
  3. Confirm the title stays as plain title text and the article HTML is pasted into the body editor after it appears.

Additional Notes / 补充说明

  • pnpm lint still reports existing MV3 Firefox compatibility warnings/errors unrelated to this patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant